#ifndef _XN_CTRL_H
#define _XN_CTRL_H

#include <XnOpenNI.h>
#include <XnCodecIDs.h>
#include <XnCppWrapper.h>

class XNCtrl
{
public:
	XNCtrl(void);
	~XNCtrl(void);

public:
	void CleanupExit();
// 	void StartCapture();
// 	void StopCapture();
	void ReadNextData();
	void IdleClean();
/*	void Pause();*/
	int Init();	
	int InitFromCode();
	void DrawPlayerNote(int player);

	void NewUser(xn::UserGenerator& generator, XnUserID user, void* pCookie);
	void setPlayer(int &player);
	void getMetaData(xn::SceneMetaData& sceneMD);
	void getMetaData(xn::DepthMetaData& depthMD);
	void getMetaData(xn::ImageMetaData& imageMD);
	void getHFov(double &hfov,double &vfov);

private:
	xn::Context m_Context;
	xn::Recorder* g_pRecorder;

	xn::DepthGenerator m_DepthGenerator;
	xn::UserGenerator m_UserGenerator;
	xn::ImageGenerator m_ImageGenerator;

	bool m_bCalibrated;
	int m_nPlayer;
	bool m_bQuit;
	bool m_bPause;

};

#endif